<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 使用立即执行函数实现模块化
        (function(){
            var msg = 'Hello JsModule'
            function sayHello(){
                console.log('Hi' + msg)
            }
            function sayOther(){
                console.log('Other' + msg)
            }
            window.Module = {
                sayHello: sayHello,
                sayOther: sayOther
            }
        })()
    </script>
    <script>
        Module.sayHello()
        Module.sayOther()
    </script>
</body>
</html>